<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv=X-UA-Compatible content=IE=8/>

    <title>蘑菇街</title>
    <link rel="stylesheet" href="/shopping/Public/Home/css/normalize.css" type="text/css" />
    <link rel="stylesheet" href="/shopping/Public/Home/css/font-awesome.min.css"  type="text/css" />
    <link rel="stylesheet" href="/shopping/Public/Home/css/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="/shopping/Public/layui/css/layui.css" type="text/css"/>



    <link rel="stylesheet" href="/shopping/Public/Home/css/index.css" type="text/css" />
    <script>
        var Public = "/shopping/Public";
    </script>
    <script src="/shopping/Public/Home/js/jquery-1.7.2.js" ></script>
    <script src="/shopping/Public/Home/js/jquery-1.11.3.js" ></script>
    <script src="/shopping/Public/Home/js/bootstrap.min.js" ></script>
    <script src="/shopping/Public/Home/js/jQueryRotate.js" ></script>
    <script src="/shopping/Public/Home/js/snowfall.jquery.js"></script>
    <script src="/shopping/Public/layui/layui.js" ></script>

</head>
<body>

<!--头部导航栏开始-->
<div class="header-nav">
    <div class="header-wrap">
        <a class="mgj-home" href="<?php echo U('Index/index');?>">商城首页</a>
        <ul class="header-wrap-nav">
            <?php if(empty($_SESSION['home'])): ?><li class="login header-item">
                    <a href="<?php echo U('User/register');?>">注册</a>
                    <a href="<?php echo U('User/login');?>" id="login">登录</a>
                </li>
            <?php else: ?>
                <li class="login header-item">
                    <a href="#">
                        <?php if(empty($_SESSION['home']['user_img'])): ?><img src="/shopping/Public/Home/images/head.png" style="height: 24px;display: inline-block;border-radius: 12px">
                        <?php else: ?>
                            <img src="<?php echo get_img_url('/shopping/Uploads/user',$_SESSION['home']['user_img'],50);?>" style="height: 24px;display: inline-block;border-radius: 12px"><?php endif; ?>

                    </a>
                    <a href="<?php echo U('Usercenter/index');?>"><?php echo ($_SESSION['home']['name']); ?></a>
                    <a href="<?php echo U('User/out');?>">退出</a>
                </li><?php endif; ?>

            <li class="order header-item">
                <a href="<?php echo U('Usercenter/myOrder');?>">我的订单</a>
            </li>
            <li class="cart header-item"id="cart">
                <a href="<?php echo U('User/cart');?>">购物车</a>
                <div class="empty-cart">购物车里没有商品</div>

            </li>


        </ul>
    </div>
</div>
<!--头部导航栏结束-->


    <!-- 登录开始 -->
    <div class="conatiner mt40">
        <div class="clearfix mt40"></div>
        <h1 class="text-center mt40">登录</h1>
        <hr>

        <form action="<?php echo U('User:loginDo');?>" method="post" class="form-horizontal col-md-6 col-md-offset-3 h4" id="login">

            <div class="form-group">
                <label for="user" class="col-md-3 control-label">用户名</label>
                <div class="col-md-9">
                    <input type="text" name="name" class="form-control" id="user" placeholder="请输入用户名..">
                    <span class="text-info"></span>
                </div>
            </div>

            <div class="form-group">
                <label for="pwd" class="col-md-3 control-label">密码</label>
                <div class="col-md-9">
                    <input type="password" name="pwd" class="form-control" id="pwd" placeholder="请输入密码..">
                    <span class="text-info"></span>
                </div>
            </div>



            <div class="form-group">
                <div class="col-md-9 col-md-offset-3">
                    <div class="pull-left">
                        <input type="text" name="vcode" id="code" class="form-control" placeholder="验证码">
                    </div>
                    <div class="pull-right">
                        <img src="<?php echo U('User:verify');?>" title="点 我 刷 新" style="cursor:pointer" onclick="this.src=this.src+'?i='+Math.random()" class="pull-right">
                    </div>
                </div>
            </div>


            <div class="form-group">
                <div class="col-md-offset-3 col-md-9">
                    <button type="submit" id="sub" class="btn btn-primary">登了个录</button>
                    <button type="reset" class="btn btn-danger pull-right">清空重填</button>
                </div>
            </div>

        </form>
    </div>
    <!-- 登录结束 -->
    <script>
        $(function(){
            var register = false;
            $("#user").blur(function(){
                var username = $("#user").val();
                var userRegx = /^[a-zA-Z]\w{3,14}$/;
                if(!userRegx.test(username)){
                    $("#user").siblings().html("* 以字母开头,4-15个字符,由数字字母下划线组成");
                    $("#user").siblings().css("color","red");
                    return register = fasle;
                }else{
                    $("#user").siblings().html("");
                    $("#user").siblings().css("color","#31708f");
                    return register = true;
                }
            })
            $("#pwd").blur(function(){
                var pwd = $("#pwd").val();
                var pwdRegx = /^\S{4,20}$/;
                if(!pwdRegx.test(pwd)){
                    $("#pwd").siblings().html("* 由4-20位组成");
                    $("#pwd").siblings().css("color","red");
                    return register = false;
                }else{
                    $("#pwd").siblings().html("");
                    $("#pwd").siblings().css("color","#31708f");
                    return register = true;
                }
            })

            $("#sub").click(function(){
                //如果输入框有空值的,不提交表单
                if($("#user").val() == "" || $("#pwd").val() == ""){
                    return false;
                }
                return register;
            })

        })
    </script>

<!--页脚开始-->
<div class="footer clearfix">
    <div class="footer-wrap">
        <!--左边开始-->
        <div class="footer-info">
            <a href="#">
                <img src="/shopping/Public/Home/images/logo.png" alt="">
            </a>
            <div class="footer-info-text">
                <p>
                    营业执照注册号：
                    <a  href="#" >330106000129004</a>
                </p>
                <p>
                    增值电信业务经营许可证：
                    <a   href="#">浙B2-20110349</a>
                </p>
                <p style="height: auto">
                    网络文化经营许可证：
                    <a   href="#">浙网文（2016）0349-219号</a>
                </p>
                <p>
                    <a   href="#">安全责任书</a>
                </p>
                <p>
                    <a  href="#" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
                        <img src="/shopping/Public/Home/images/jinghui_20x20.png"style="float:left;">
                        <span style="color: #999;">&nbsp;浙公网安备 33010602002329号</span>
                    </a>
                </p>
                <p class="mogujiecom">©2016 Mogujie.com 杭州卷瓜网络有限公司</p>
            </div>
        </div>
        <!--左边结束-->

        <!--中间开始-->
        <div class="footer-link">
            <dl>
                <dt>公司</dt>
                <dd><a href="#">关于我们</a></dd>
                <dd><a href="#">招聘信息</a></dd>
                <dd><a href="#">联系我们</a></dd>
            </dl>
            <dl>
                <dt>消费者</dt>
                <dd><a href="#">消费者服务</a></dd>
                <dd><a href="#">意见反馈</a></dd>
                <dd><a href="#">手机版下载</a></dd>
            </dl>
            <dl>
                <dt>商家</dt>
                <dd><a href="#">商家入驻</a></dd>
                <dd><a href="#">商家后台</a></dd>
                <dd><a href="#">蘑菇商学院</a></dd>
                <dd><a href="#">商家社区 </a></dd>
            </dl>
        </div>
        <!--中间结束-->

        <!--右边开始-->
        <div class="link-safe">
            <dl>
                <dt>权威认证</dt>
                <dd class="bank">
                    <a href="#"></a>
                </dd>
                <dd class="web">
                    <a href="#"></a>
                </dd>
            </dl>
        </div>
        <!--右边结束-->
    </div>
</div>
<!--页脚结束-->
<script src="/shopping/Public/Home/js/index.js" ></script>
</body>
</html>